﻿@model UnityWeb.Models.GridRun.GridRunStatusViewModel
@using UnityWeb.Models.GridRun
@using UnityWeb.Resources.GridRun

<h3 class="gridRunStatus">@Model.Grid</h3>
<ul class="itemprogress">
  @if (Model.Arrived != null)
  {
    <li class="complete">
      @Status.DataArrival<br /><br />
      <img src="@Url.Content("~/images/complete.jpg")" alt="Complete" /><br /><br />
      @Model.Arrived
      <br /><br />
    </li>
  }
  else
  {
    <li class="inComplete">
      @Status.DataArrival<br /><br />
      <img src="@Url.Content("~/images/incomplete.jpg")" alt="InComplete" /><br /><br /><br />
      <br />
    </li>
  }
  @if (Model.Proccessed != null)
  {
    <li class="complete">
      @Status.Processed<br /><br />
      <img src="@Url.Content("~/images/complete.jpg")" alt="Complete" /><br /><br />
      @Model.Proccessed
      <br /><br />
    </li>
  }
  else
  {
    <li class="inComplete">
      @Status.Processed<br /><br />
      <img src="@Url.Content("~/images/incomplete.jpg")" alt="InComplete" /><br /><br />
      <br /><br />
    </li>
  }
  @switch (this.Model.ApprovalStatus)
  {
    case (int)GridRunStatusViewModel.ApprovalStatuses.FullyApproved:
      <li class="complete">
        @Status.ApprovedTitle<br /><br />
        <img src="@this.Url.Content("~/images/complete.jpg")" alt="Complete" /><br /><br />
        @Status.Approved @Model.ApprovedBy on <br /> @Model.ApprovalDate<br />
      </li>
      break;
    case (int)GridRunStatusViewModel.ApprovalStatuses.Unapproved:
      <li class="inComplete">
        @Status.ApprovedTitle<br /><br />
        <img src="@this.Url.Content("~/images/incomplete.jpg")" alt="InComplete" /><br /><br />
        @Status.Unapproved<br /><br />
      </li>
      break;
      case (int)GridRunStatusViewModel.ApprovalStatuses.PartiallyApproved:
      <li class="inComplete">
        @Status.ApprovedTitle<br /><br />
        <img src="@this.Url.Content("~/images/warning.jpg")" alt="InComplete" /><br /><br />
        @Status.PartiallyApproved @Model.ApprovedBy on <br /> @Model.ApprovalDate<br />
      </li>
      break;
     case (int)GridRunStatusViewModel.ApprovalStatuses.FullyRejected:
      <li class="inComplete">
        @Status.ApprovedTitle<br /><br />
        <img src="@this.Url.Content("~/images/warning.jpg")" alt="InComplete" /><br /><br />
        @Status.Rejected @Model.RejectedBy on <br /> @Model.RejectedDate <br />
      </li>
      break;
    default:
      <li class="inComplete">
        @Status.ApprovedTitle<br /><br />
        <img src="@this.Url.Content("~/images/warning.jpg")" alt="InComplete" /><br /><br />
        <br /><br />
      </li>
      break;
  }
  
  @switch (this.Model.HouseHoldStatus)
  {
    case (int)GridRunStatusViewModel.HouseHoldingStatuses.FullyHouseHeld:
      <li class="complete">
        @Status.Househeld<br /><br />
        <img src="@Url.Content("~/images/complete.jpg")" alt="Complete" /><br /><br />
        @Status.Househeld on <br /> @Model.HouseHoldingDate<br />
      </li>
      break;
    case (int)GridRunStatusViewModel.HouseHoldingStatuses.PartiallyHouseHeld:
      <li class="inComplete">
        @Status.PartiallyHouseHeld<br /><br />
        <img src="@Url.Content("~/images/warning.jpg")" alt="InComplete" /><br /><br />
        @Status.PartiallyHouseHeld on <br /> @Model.HouseHoldingDate<br />
      </li>
      break;
    default:
      <li class="inComplete">
        @Status.Househeld<br /><br />
        <img src="@this.Url.Content("~/images/incomplete.jpg")" alt="InComplete" /><br /><br />
        @Status.NonHouseHeld <br /><br />
      </li>
      break;
  }
</ul>
